package com.crl.utils.timer
{
	import flash.utils.Timer;
	
	
	/**
	 *  帧频触发器;
	 *  
	 * @author crl
	 * 
	 */	
	public class FrameRate extends Timer
	{
		protected var _fps:int;

		protected var _isRunning:Boolean;
		
		public function FrameRate(fps:int)
		{
			_fps = (fps > -1) ? fps : 30;
			
			
			var t:int=Math.round(1000 / _fps);
			
			super(t,0);
		}
		
		public function set fps(value:uint):void{
			this._fps=value;
			
			var t:int=Math.round(1000 / _fps);
			
			this.delay=t;
		}
		
		public function get frameRate():int
		{
			return _fps;
		}

	}
}